import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/login',
      component: () => import('@/views/system/login/Index'),
      children: [
        {
          name: 'Login',
          path: '',
          component: () => import('@/views/system/login/Login')
        }
      ]
    },
    {
      path: '/system',
      component: () => import('@/views/system/Index'),
      children: [
        {
          name: '用户管理',
          path: 'user-index',
          component: () => import('@/views/system/user/Index')
        },
        {
          name: '部门管理',
          path: 'dept-index',
          component: () => import('@/views/system/dept/Index')
        },

        {
          name: '菜单管理',
          path: 'menu-index',
          component: () => import('@/views/system/menu/Index')
        }
      ]
    },
    {
      path: '/',
      component: () => import('@/views/system/Index'),
      children: [
        // Dashboard
        {
          name: 'Dashboard',
          path: '',
          component: () => import('@/views/dashboard/Dashboard')
        },
        // Tables
        {
          name: 'Regular Tables',
          path: 'tables/regular-tables',
          component: () => import('@/views/dashboard/tables/RegularTables')
        },
        {
          name: 'Extended Tables',
          path: 'tables/extended-tables',
          component: () => import('@/views/dashboard/tables/ExtendedTables')
        },
        {
          name: 'Data Tabels',
          path: 'tables/data-tables',
          component: () => import('@/views/dashboard/tables/DataTables')
        },
      ]
    },
  ]
})
